/*
 * @(#)MockResultGenerator.java $version 2010. 8. 11
 *
 * Copyright 2007-2010 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.nhncorp.usf.test;

import java.util.HashMap;
import java.util.Map;

import com.nhncorp.usf.core.config.runtime.ResultPageInfo;
import com.nhncorp.usf.core.result.ResultGenerator;
import com.nhncorp.usf.core.xwork.UsfActionInvocation;

/**
 * @author Web Platform Development Team
 */
public class MockResultGenerator extends ResultGenerator {
	private ResultPageInfo resultPageInfo;
	private Map<String, Object> dataModel;
	
	public MockResultGenerator() {
	}

	/**
     * {@link ResultPageInfo} 를 executeInfo 에 set 한다.
     *
     * @param usfActionInvocation the invaction instance
     * @throws Exception Exception the exception Result 실패시 던져지는 예외
     */
	@SuppressWarnings("unchecked")
	@Override
    public void executeResult(UsfActionInvocation usfActionInvocation) throws Exception {
        resultPageInfo = usfActionInvocation.getResultPageInfo();
        
		dataModel = new HashMap();
		dataModel.putAll(usfActionInvocation.getDataMap());
    }

	public ResultPageInfo getResultPageInfo() {
		return resultPageInfo;
	}

	public void setResultPageInfo(ResultPageInfo resultPageInfo) {
		this.resultPageInfo = resultPageInfo;
	}

	public Map<String, Object> getDataModel() {
		return dataModel;
	}
}
